package com.wsx.ones.monitor.core.codec;

import com.wsx.ones.monitor.core.transport.Channel;

import java.io.IOException;

/**
 * 序列化的高层接口设计，设计处理netty中的encode和decode的处理
 * Created by wangshuaixin on 17/2/4.
 */
public interface Codec {

    final static int HEADER_LENGTH = 4;

    byte[] encode(Channel channel, Object message) throws IOException;

    Object decode(Channel channel, String remoteIp, byte[] bytes) throws IOException;
}
